//
//  LCShengJingSearchResultsCell.m
//  JKFuYinProject
//
//  Created by admin on 2018/3/19.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LCShengJingSearchResultsCell.h"

@implementation LCShengJingSearchResultsCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    self.labelContent = [[UILabel alloc] init];
    self.labelContent.textColor = RGBColor(10, 10, 10);
    self.labelContent.font = [UIFont systemFontOfSize:14];
    self.labelContent.numberOfLines = 3;
    [self addSubview:self.labelContent];
    
    self.labelRemark = [[UILabel alloc] init];
    self.labelRemark.font = [UIFont systemFontOfSize:14];
    self.labelRemark.textColor = RGBColor(140, 140, 140);
    [self addSubview:self.labelRemark];
    
    self.labelContent.sd_layout
    .leftSpaceToView(self, 10)
    .topSpaceToView(self, 10)
    .heightIs(14); // 设置高度约束
    [self.labelContent setSingleLineAutoResizeWithMaxWidth:(ScreenWidth)];
    
    self.labelRemark.sd_layout
    .leftSpaceToView(self, 10)
    .rightSpaceToView(self, 10)
    .topSpaceToView(self, 36)
    .autoHeightRatio(0); // 设置高度约束
}

-(void)setContentMg:(LSZSearchKeyContentMg *)contentMg {
    self.labelContent.text = [NSString stringWithFormat:@"%@",contentMg.title];
    self.labelRemark.text = [NSString stringWithFormat:@"%@",contentMg.content];
    [self setupAutoHeightWithBottomView:self.labelRemark bottomMargin:10];
}

@end
